import React, {Component} from 'react';
import PropTypes from "prop-types";
class TodoHeader extends Component {
    static propTypes = {
        addTodo:PropTypes.func.isRequired
    }
    render() {
        return (
            <div className="todo-header">
                <input onKeyUp={this.props.addTodo} type="text" placeholder="请输入你的任务名称，按回车键确认"/>
            </div>
        );
    }
}

export default TodoHeader;